package com.ddstation.common.session;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

public class SysContent {
	
	private static ThreadLocal<HttpServletRequest> requestLocal = null;
    private static ThreadLocal<HttpServletResponse> responseLocal = null;
    
	public static ThreadLocal<HttpServletRequest> getRequest() {
		return requestLocal;
	}
	
	public static void setRequest(ThreadLocal<HttpServletRequest> request) {
		requestLocal = request;
	}
	
	public static ThreadLocal<HttpServletResponse> getResponse() {
		return responseLocal;
	}
	
	public static void setResponse(ThreadLocal<HttpServletResponse> response) {
		responseLocal = response;
	}
	
	public static HttpSession getSession() {
		if (requestLocal == null || requestLocal.get() == null) {
			return null;
		}
		return requestLocal.get().getSession();
	}
}
